﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="persondoc_mydoc_frame.aspx.cs" Inherits="Ccit.OA.PersonDoc.persondoc_mydoc_frame" %>
<%@ Register TagPrefix="ccit" Namespace="Ccit.ServerControls" Assembly="Ccit.ServerControls.ActionForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>个人文档管理</title>
        <script language="javascript" type="text/javascript" src="../script/jquery.js"></script>
    <script language="javascript" type="text/javascript" src="../script/StringClass_Ext.js"></script>
    <script language="javascript" type="text/javascript" src="../script/jsonlib.js"></script>
    <script language="javascript" src="../script/jwindow.js" type="text/javascript"></script>
    <script language="javascript" src="../script/jcontrol.js" type="text/javascript"></script>
    <script language="javascript" src="../script/jbase64.js" type="text/javascript"></script>
    <script language="javascript">
     function doAddFolder()
     {
        self.frames[1].document.location.href = "persondoc_folder_edit.aspx";
     }  
     
     //新增文件
     function doAddFile()
     {
        
        if(document.getElementById('lkA1').disabled == false)
        {
            self.frames[1].document.location.href = "persondoc_file_upload.aspx" ;

        }
        return false;
     }
     
     function doAddNewFolder()
     {
     
      if(document.getElementById('lkAdd').disabled == false)
        {
           self.frames[1].document.location.href = "persondoc_folder_edit.aspx" ;
        }
        return false;
     }
     
     function doFolder()
     {
        if(document.getElementById("lkFolder").disabled == false)
        {
            folderButton();
            self.frames[0].document.location.href = "persondoc_mydoc_tree.aspx" ;
            return false;
        }
        else{
            return false;
        }
        return true;
     }     
     
     //检索
     function doSearch()
     {
        if(document.getElementById("lkSearch").disabled == false)
        {
            SearchButton();
            self.frames[0].document.location.href = "persondoc_mydoc_search.aspx" ;
            return false
        }
        else{
            return false;
        }
        return true;
     }     
     
     /* FuncDesc:   删除文件信息
     * FuncParam:  none
     * FuncReturn: void
     */
     function doBatDelete() {
            if(document.getElementById("lkDel").disabled == false)
            {
                if(self.frames[1].getFoldType() == "-2" && self.frames[1].getShare() != "00")
                { 
                    alert('此文件夹为只读共享,不允许粘贴!');
                }
                else{
                    self.frames[1].doBatDelete();
                }
            }
            return false;
        }
     
     //剪切
     function doShear()
     {
        if(document.getElementById('lkA3').disabled == false)
        {
            if(self.frames[1].getFileId() == "")
            {
                alert("请先选择要剪切的文件!");
            }
            else
            {
                if(self.frames[1].getFileId() != "")
                {
                    document.getElementById("hidId").value = self.frames[1].getFileId();
                    document.getElementById("hidType").value = self.frames[1].getFileType();
                    document.getElementById("hidFiesName").value = self.frames[1].document.getElementById("hidFiesName").value;
                    document.getElementById("hidWork").value = "Shear";
                    ztButton();
                }
                else
                {
                    alert("请先选择要剪切的文件!");
                }
            }
        }
        return false;
     }
     
     //复制
     function doCode()
     {
         if(document.getElementById('lkA2').disabled == false)
        {
            if(self.frames[1].getFileId() != "")
            {
                document.getElementById("hidId").value = self.frames[1].getFileId();
                document.getElementById("hidType").value = self.frames[1].getFileType();
                document.getElementById("hidFiesName").value = self.frames[1].document.getElementById("hidFiesName").value;
                document.getElementById("hidWork").value = "Code";
                ztButton();
            }
            else
            {
                alert("请先选择要复制的文件!");
            }
        }
            return false;
     }
     
     //粘贴按钮判断
     function ztButton()
     {
        if(self.frames[1].getShare() == "00")
        {
            if(self.frames[1].getFileId() == "")
            {
                document.getElementById("lbZT").disabled = true;
                document.getElementById("lkDel").disabled = true;
                document.getElementById("lkA2").disabled = true;
                document.getElementById("lkA3").disabled = true;
            }
            else
            {
                if(document.getElementById("hidWork").value != "")
                {
                    document.getElementById("lbZT").disabled = false;
                }
                document.getElementById("lkDel").disabled = false;
                document.getElementById("lkA2").disabled = false;
                document.getElementById("lkA3").disabled = false;
            }
        }
     }
     
     function SearchButton()
     {
            document.getElementById("lkFolder").disabled = false;
            document.getElementById("lkSearch").disabled = true;
     }
     
     function folderButton()
     {
         document.getElementById("lkFolder").disabled = true;
         document.getElementById("lkSearch").disabled = false;
     }
     
     
     //粘贴
     function doSave()
     {
        if(document.getElementById('lbZT').disabled == false)
        {

            if(self.frames[1].getFoldType() == "2" || self.frames[1].getShare() != "00")
            {
                alert('此文件夹为只读共享,不允许粘贴!');
            }
            else
            {
                var sId = document.getElementById("hidId").value;
                var sType = document.getElementById("hidType").value;
                self.frames[1].doShearFile();
            }
         }
        return false;
     }
     
     function doMenuNone()
     {
        document.getElementById("divMenu").style.display = "none";
     }
     
     function doMenuBlock()
     {
        document.getElementById("divMenu").style.display = "block";
     }
     
     function doLoad()
     {
     
        if(self.frames[1].getShare() != "00")
        {
            document.getElementById("lkAdd").disabled = true;
            document.getElementById("lkA1").disabled = true;
            document.getElementById("lkA2").disabled = true;
            document.getElementById("lkA3").disabled = true;
            document.getElementById("lbZT").disabled = true;
            document.getElementById("lkDel").disabled = true;
        }
        else {
                if(self.frames[1].getFolder() != "0")
                {
                    if(document.getElementById("hidId").value != "")
                    {
                        if(document.getElementById("hidWork").value != "")
                        {
                            document.getElementById("lbZT").disabled = false;
                        }
                        else 
                        {
                            document.getElementById("lbZT").disabled = true;
                        }
                        document.getElementById("lkDel").disabled = false;
                        document.getElementById("lkA2").disabled = false;
                        document.getElementById("lkA3").disabled = false;
                    }
                    else
                    {
                        document.getElementById("lkAdd").disabled = false;
                        document.getElementById("lkA1").disabled = false;
                        document.getElementById("lkA2").disabled = true;
                        document.getElementById("lkA3").disabled = true;
                        document.getElementById("lbZT").disabled = true;
                        document.getElementById("lkDel").disabled = true;
                      }
                }
                else
                {
                    document.getElementById("lkA1").disabled = true;
                    document.getElementById("lkAdd").disabled = false;
                    document.getElementById("lkA2").disabled = true;
                    document.getElementById("lkA3").disabled = true;
                }
                    
                }
     }
     
    </script>
</head>
<body>
     <ccit:ActionForm id="form1" runat="server">
      <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
    </asp:ScriptManager> 
    <table class="tbToolbar" cellpadding="0" cellspacing="0" width="98%" align="center" id="TablePrint">
                    <tr>
                        <td align="left">
                            <div class="tbSeparator"></div>
                        </td>
                        <td width="40%" class="titlebar">  
                            个人文档管理
                        </td>      
                        <td align="right" class="titlebar">
                            <nobr> 
                            <asp:LinkButton runat="server" CssClass="linktext" ID="lkSearch" > <img src="../images/toolbar/search.gif" border="0" style="vertical-align:middle">检索</asp:LinkButton>
                            <asp:LinkButton runat="server" CssClass="linktext" ID="lkFolder" disabled><img src="../images/toolbar/folder_open.gif" border="0" style="vertical-align:middle">文件夹</asp:LinkButton>
						        &nbsp;&nbsp;&nbsp;</nobr></td>          
                        <td align="right" id="divMenu" style="display:block">
                            <nobr >
                            <asp:LinkButton runat="server" CssClass="linktext" ID="lkAdd" disabled><img src="../images/toolbar/addnew_bq.gif" border="0" style="vertical-align:middle">新增文件夹</asp:LinkButton>
                            <asp:LinkButton runat="server" CssClass="linktext" ID="lkA1" disabled><img src="../images/toolbar/addnew_bq.gif" border="0" style="vertical-align:middle">新增文件</asp:LinkButton>
                            <asp:LinkButton runat="server" CssClass="linktext" ID="lkA2" disabled><img src="../images/toolbar/Unhot.gif" border="0" style="vertical-align:middle">复制</asp:LinkButton>
                            <asp:LinkButton runat="server" CssClass="linktext" ID="lkA3" disabled><img src="../images/toolbar/back.gif" border="0" style="vertical-align:middle">剪切</asp:LinkButton>
                             <asp:LinkButton runat="server" ID="lbZT" disabled CssClass="linktext"><img src="../images/toolbar/rename_bq.gif" border="0" style="vertical-align:middle">粘贴</asp:LinkButton>
                            <asp:LinkButton runat="server" CssClass="linktext" ID="lkDel" disabled><img src="../images/toolbar/delete.gif" border="0" style="vertical-align:middle">删除</asp:LinkButton>
                             </nobr>
                        </td> 
                    </tr>
        </table>
       <table class="tableborder" cellpadding="0" cellspacing="0" width="98%" height="94.2%" align="center">
            <tr>
                <td width="25%">
                    <iframe id="iFrmTree" name="iFrmTree" height="99%" width="98%" scrolling="auto"
						    src="persondoc_mydoc_tree.aspx" style="BORDER-RIGHT: #000000 1px solid" frameborder="0"></iframe>
                </td>
                <td width="75%">
                    <iframe id="iFrmEdit" name="iFrmEdit" height="99%" width="98%" scrolling="yes"
						    src="persondoc_mydoc_list.aspx" frameborder="0"></iframe>
                </td>
            </tr>
    </table>
    <input type="hidden" id="hidId"  runat="server"/>
    <input type="hidden" id="hidType"  runat="server"/>
    <input type="hidden" id= "hidWork" runat="server" />
    <input type="hidden" id="hidFiesName" runat="server" />
    </ccit:ActionForm>
</body>
</html>
